<?php 
switch($mode)
{
	case "kelas_tahun_semester" :
		?>
		<table class="table">
			<tr>
				<td colspan="2">
				Pilih Kelas, Tahun Ajaran dan Semester
				</td>
			</tr>
            <tr>
				<td>
					Kelas
				</td>
				<td>
					<select id="kelas" name="kelas">
						<option value="">-Pilih Kelas-</option>
						<?php 
						foreach($kelas as $k)
						{
							echo "<option value='".$k['kode_kelas']."'>".$k['nama_kelas']."</option>";
						}
						?>
					</select>
				</td>
			</tr>
			<tr>
				<td>
					Tahun Ajaran
				</td>
				<td>
					<select id="tahun" name="tahun">
						<option value="">-Pilih Tahun Ajaran-</option>
						<?php 
						foreach($tahun as $t)
						{
							echo "<option value='".$t['id_tahun_ajaran']."'>".$t['tahun_ajaran']."</option>";
						}
						?>
					</select>
				</td>
			</tr>
            <tr>
				<td>
					Semester
				</td>
				<td>
					<select id="semester" name="semester">
						<option value="">-Pilih Semester-</option>
						<?php 
						foreach($semester as $s)
						{
							echo "<option value='".$s['id_semester']."'>".$s['semester']."</option>";
						}
						?>
					</select>
				</td>
			</tr>
			<tr>
				<td colspan="2">
				<a href="" name="lanjut" id="lanjut">Lanjutkan</a>
				</td>
			</tr>
		</table>
        
<?php
	if($cek_transfer != NULL){
?>		
        
        <br />
		<table class="table">
		  <tr>
		    <td colspan="2"> Data Nilai Transfer</td>
	      </tr>
		  <tr>
		    <td> Tahun Ajaran </td>
		    <td><select id="tahun2" name="tahun2">
		      <option value="">-Pilih Tahun Ajaran-</option>
		      <?php 
						foreach($tahun_transfer as $t_transfer)
						{
							echo "<option value='".$t_transfer['id_tahun_ajaran']."'>".$t_transfer['tahun_ajaran']."</option>";
						}
						?>
		      </select></td>
	      </tr>
		  <tr>
		    <td> Semester </td>
		    <td><select id="semester2" name="semester2">
		      <option value="">-Pilih Semester-</option>
		      <?php 
						foreach($semester_transfer as $s_transfer)
						{
							echo "<option value='".$s_transfer['id_semester']."'>".$s_transfer['semester']."</option>";
						}
						?>
		      </select></td>
	      </tr>
		  <tr>
		    <td colspan="2"><a href="" name="lanjut2" id="lanjut2">Lanjutkan</a></td>
	      </tr>
</table>
<script type="text/javascript">
						
			$("#tahun2").change(function(){
				pasangHoy2();	
			});
			
			$("#semester2").change(function(){
				pasangHoy2();
			});
			
			function pasangHoy2()
			{
				var tahun_transfer = $("#tahun2").val();
				var semester_transfer = $("#semester2").val();
				$("#lanjut2").attr("href", "<?php echo $baseUrlSave."siswa/manual/cek_nilai_sub_siswa/transfer/"?>"+tahun_transfer+"/"+semester_transfer);
			}
		</script>

<?php
	}
?>
        
		<?php		
	break;
	case "nilai":
		?>
		<table class="table">
			<tr>
				<td>
					Kelas
				</td>
				<td>
					<?php echo $kelas['nama_kelas']?>
				</td>
			</tr>
            <tr>
				<td>
					Tahun Ajaran
				</td>
				<td>
					<?php echo $tahun['tahun_ajaran']?>
				</td>
			</tr>
  
			<tr>
				<td>
					Semester
				</td>
				<td>
					<?php echo $semester['semester']?>
				</td>
			</tr>
			
			<tr>
                <td >
				<a href="<?php echo $baseUrlSave."siswa/manual/cek_nilai_sub_siswa/";?>" name="" id="">Kembali</a>
				</td>
                <td >
				<a onclick="print_doc('<?php echo $base_url; ?>hasil_study/<?php echo $siswa."/".$kelas['kode_kelas']."/".$tahun['id_tahun_ajaran']."/".$semester['id_semester']; ?>')" >Print KHS</a>
				</td>
			</tr>
		</table>
		<table class="table">
			<tr>
				<td>No</td>
				<td>Mata Kuliah</td>
				<td>Nilai</td>
                <td>Mengulang</td>
			</tr>
		<?php 
		foreach($list_siswa as $i=>$ls)
		{
			?>
			<tr>
				<td><?php echo ($i+1);?></td>
				<td><?php echo $ls['mata_kuliah']?></td>
				<td align="center"><?php echo $ls['nilai']?></td>
                <td align="center">
                <?php
				$mk_skrg = $ls['kode_mata_kuliah'];
				if($mengulang!=NULL){
					foreach($mengulang as $ulg)
					{
						$mk_ulang = $ulg->kode_mata_kuliah;
						if($mk_skrg == $mk_ulang){
							echo $ulg->nilai;
						}
					}
				}
				?>
                </td>
			</tr>
			<?php 
		}
		?>
		</table>
<script type="text/javascript">

function print_doc(alamat){
	window.open(alamat,'Akademi Perikanan Yogyakarta',"width=750,height=650");
}

</script>
		<?php		
	break;
	case "nilai_transfer":
		?>
		<table class="table">
            <tr>
				<td>
					Tahun Ajaran
				</td>
				<td>
					<?php echo $tahun['tahun_ajaran']?>
				</td>
			</tr>
  
			<tr>
				<td>
					Semester
				</td>
				<td>
					<?php echo $semester['semester']?>
				</td>
			</tr>
			
			<tr>
                <td >
				<a href="<?php echo $baseUrlSave."siswa/manual/cek_nilai_sub_siswa/";?>" name="" id="">Kembali</a>
				</td>
                <td >
				<a onclick="print_doc('<?php echo $base_url; ?>hasil_study_transfer/<?php echo $siswa."/".$tahun['id_tahun_ajaran']."/".$semester['id_semester']; ?>')" >Print KHS</a>
				</td>
			</tr>
		</table>
		<table class="table">
			<tr>
				<td>No</td>
				<td>Mata Kuliah</td>
				<td>Nilai</td>
			</tr>
		<?php 
		foreach($list_siswa as $i=>$ls)
		{
			?>
			<tr>
				<td><?php echo ($i+1);?></td>
				<td><?php echo $ls['mata_kuliah']?></td>
				<td align="center"><?php echo $ls['nilai']?></td>
			</tr>
			<?php 
		}
		?>
		</table>
<script type="text/javascript">

function print_doc(alamat){
	window.open(alamat,'Akademi Perikanan Yogyakarta',"width=750,height=650");
}

</script>
		<?php		
	break;
}
?>